<?php

namespace App\Http\Controllers;

use App\Message;
use Illuminate\Http\Request;

class MessagesController extends Controller
{
	//
	public function store(Request $request)
	{

		$message = Message::create(
			array_merge(['from_user_id' => user('api')->id],
				$request->all()
			)
		);

		if ($message) {
			\Flash::message('发送成功');
			return response()->json(['status' => true]);
		}

		return response()->json(['status' => false]);
	}
}
